{"ast":null,"code":"import _extends from \"@babel/runtime/helpers/esm/extends\";\nimport _defineProperty from \"@babel/runtime/helpers/esm/defineProperty\";\nimport _slicedToArray from \"@babel/runtime/helpers/esm/slicedToArray\";\nimport * as React from 'react';\nimport classNames from 'classnames';\nvar Notify = /*#__PURE__*/React.forwardRef(function (props, ref) {\n  var prefixCls = props.prefixCls,\n    style = props.style,\n    className = props.className,\n    _props$duration = props.duration,\n    duration = _props$duration === void 0 ? 4.5 : _props$duration,\n    eventKey = props.eventKey,\n    content = props.content,\n    closable = props.closable,\n    _props$closeIcon = props.closeIcon,\n    closeIcon = _props$closeIcon === void 0 ? 'x' : _props$closeIcon,\n    divProps = props.props,\n    onClick = props.onClick,\n    onNoticeClose = props.onNoticeClose;\n  var _React$useState = React.useState(false),\n    _React$useState2 = _slicedToArray(_React$useState, 2),\n    hovering = _React$useState2[0],\n    setHovering = _React$useState2[1];\n  // ======================== Close =========================\n  var onInternalClose = function onInternalClose() {\n    onNoticeClose(eventKey);\n  };\n  // ======================== Effect ========================\n  React.useEffect(function () {\n    if (!hovering && duration > 0) {\n      var timeout = setTimeout(function () {\n        onInternalClose();\n      }, duration * 1000);\n      return function () {\n        clearTimeout(timeout);\n      };\n    }\n  }, [duration, hovering]);\n  // ======================== Render ========================\n  var noticePrefixCls = \"\".concat(prefixCls, \"-notice\");\n  return /*#__PURE__*/React.createElement(\"div\", _extends({}, divProps, {\n    ref: ref,\n    className: classNames(noticePrefixCls, className, _defineProperty({}, \"\".concat(noticePrefixCls, \"-closable\"), closable)),\n    style: style,\n    onMouseEnter: function onMouseEnter() {\n      setHovering(true);\n    },\n    onMouseLeave: function onMouseLeave() {\n      setHovering(false);\n    },\n    onClick: onClick\n  }), /*#__PURE__*/React.createElement(\"div\", {\n    className: \"\".concat(noticePrefixCls, \"-content\")\n  }, content), closable && /*#__PURE__*/React.createElement(\"a\", {\n    tabIndex: 0,\n    className: \"\".concat(noticePrefixCls, \"-close\"),\n    onClick: function onClick(e) {\n      e.preventDefault();\n      e.stopPropagation();\n      onInternalClose();\n    }\n  }, closeIcon));\n});\nexport default Notify;","map":{"version":3,"names":["_extends","_defineProperty","_slicedToArray","React","classNames","Notify","forwardRef","props","ref","prefixCls","style","className","_props$duration","duration","eventKey","content","closable","_props$closeIcon","closeIcon","divProps","onClick","onNoticeClose","_React$useState","useState","_React$useState2","hovering","setHovering","onInternalClose","useEffect","timeout","setTimeout","clearTimeout","noticePrefixCls","concat","createElement","onMouseEnter","onMouseLeave","tabIndex","e","preventDefault","stopPropagation"],"sources":["/data/messenger.client/node_modules/rc-notification/es/Notice.js"],"sourcesContent":["import _extends from \"@babel/runtime/helpers/esm/extends\";\nimport _defineProperty from \"@babel/runtime/helpers/esm/defineProperty\";\nimport _slicedToArray from \"@babel/runtime/helpers/esm/slicedToArray\";\nimport * as React from 'react';\nimport classNames from 'classnames';\nvar Notify = /*#__PURE__*/React.forwardRef(function (props, ref) {\n  var prefixCls = props.prefixCls,\n    style = props.style,\n    className = props.className,\n    _props$duration = props.duration,\n    duration = _props$duration === void 0 ? 4.5 : _props$duration,\n    eventKey = props.eventKey,\n    content = props.content,\n    closable = props.closable,\n    _props$closeIcon = props.closeIcon,\n    closeIcon = _props$closeIcon === void 0 ? 'x' : _props$closeIcon,\n    divProps = props.props,\n    onClick = props.onClick,\n    onNoticeClose = props.onNoticeClose;\n  var _React$useState = React.useState(false),\n    _React$useState2 = _slicedToArray(_React$useState, 2),\n    hovering = _React$useState2[0],\n    setHovering = _React$useState2[1];\n  // ======================== Close =========================\n  var onInternalClose = function onInternalClose() {\n    onNoticeClose(eventKey);\n  };\n  // ======================== Effect ========================\n  React.useEffect(function () {\n    if (!hovering && duration > 0) {\n      var timeout = setTimeout(function () {\n        onInternalClose();\n      }, duration * 1000);\n      return function () {\n        clearTimeout(timeout);\n      };\n    }\n  }, [duration, hovering]);\n  // ======================== Render ========================\n  var noticePrefixCls = \"\".concat(prefixCls, \"-notice\");\n  return /*#__PURE__*/React.createElement(\"div\", _extends({}, divProps, {\n    ref: ref,\n    className: classNames(noticePrefixCls, className, _defineProperty({}, \"\".concat(noticePrefixCls, \"-closable\"), closable)),\n    style: style,\n    onMouseEnter: function onMouseEnter() {\n      setHovering(true);\n    },\n    onMouseLeave: function onMouseLeave() {\n      setHovering(false);\n    },\n    onClick: onClick\n  }), /*#__PURE__*/React.createElement(\"div\", {\n    className: \"\".concat(noticePrefixCls, \"-content\")\n  }, content), closable && /*#__PURE__*/React.createElement(\"a\", {\n    tabIndex: 0,\n    className: \"\".concat(noticePrefixCls, \"-close\"),\n    onClick: function onClick(e) {\n      e.preventDefault();\n      e.stopPropagation();\n      onInternalClose();\n    }\n  }, closeIcon));\n});\nexport default Notify;"],"mappings":"AAAA,OAAOA,QAAQ,MAAM,oCAAoC;AACzD,OAAOC,eAAe,MAAM,2CAA2C;AACvE,OAAOC,cAAc,MAAM,0CAA0C;AACrE,OAAO,KAAKC,KAAK,MAAM,OAAO;AAC9B,OAAOC,UAAU,MAAM,YAAY;AACnC,IAAIC,MAAM,GAAG,aAAaF,KAAK,CAACG,UAAU,CAAC,UAAUC,KAAK,EAAEC,GAAG,EAAE;EAC/D,IAAIC,SAAS,GAAGF,KAAK,CAACE,SAAS;IAC7BC,KAAK,GAAGH,KAAK,CAACG,KAAK;IACnBC,SAAS,GAAGJ,KAAK,CAACI,SAAS;IAC3BC,eAAe,GAAGL,KAAK,CAACM,QAAQ;IAChCA,QAAQ,GAAGD,eAAe,KAAK,KAAK,CAAC,GAAG,GAAG,GAAGA,eAAe;IAC7DE,QAAQ,GAAGP,KAAK,CAACO,QAAQ;IACzBC,OAAO,GAAGR,KAAK,CAACQ,OAAO;IACvBC,QAAQ,GAAGT,KAAK,CAACS,QAAQ;IACzBC,gBAAgB,GAAGV,KAAK,CAACW,SAAS;IAClCA,SAAS,GAAGD,gBAAgB,KAAK,KAAK,CAAC,GAAG,GAAG,GAAGA,gBAAgB;IAChEE,QAAQ,GAAGZ,KAAK,CAACA,KAAK;IACtBa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